package com.vnp.cooking.fragmenthome;

import java.util.ArrayList;

import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.vnp.cooking.R;
import com.vnp.cooking.bean.ObjCover;

import android.graphics.Bitmap.Config;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

public class CoverFragmentSlide extends Fragment {
	ImageView imgCover;
	ArrayList<ObjCover> objCovers;
	DisplayImageOptions options = new DisplayImageOptions.Builder()
								.cacheOnDisc(true)
								.bitmapConfig(Config.RGB_565)
								.cacheInMemory(true)
								.build();

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);	
		
//		Bundle b = getArguments();
//		objCovers = b.getParcelableArrayList("urlImage");
		
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View v = null;
			
		v = inflater.inflate(R.layout.cover_slide_item, container, false);
		imgCover = (ImageView) v.findViewById(R.id.img_cover_item);
			
		
		Log.i("Test", getArguments().getString("urlImage"));
		String urlImage = getArguments().getString("urlImage");
		ImageLoader.getInstance().displayImage(urlImage, imgCover, options);
		return v;
	}
	
	
	
	

}
